/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykht.proj.common.core.util.R;
import com.ykht.proj.coupon.entity.CnBrand;
import com.ykht.proj.coupon.entity.CnShop;
import com.ykht.proj.coupon.entity.FxShopMoneyFlow;
import com.ykht.proj.coupon.entity.FxWithdrawal;
import com.ykht.proj.coupon.vo.BaseSearchTimeVo;

import java.math.BigDecimal;
import com.ykht.proj.coupon.vo.FxShopMoneyFlowVo;
import com.ykht.proj.coupon.vo.MoneyFlowVo;

import java.util.List;

/**
 * 门店资金流水
 *
 * @author proj code generator
 * @date 2021-02-01 19:00:17
 */
public interface FxShopMoneyFlowService extends IService<FxShopMoneyFlow> {

	/**
	 * 门店账户余额
	 * @param shopId
	 * @return
	 */
    BigDecimal shopBalance(Long shopId, BaseSearchTimeVo timeVo);
    BigDecimal shopBalanceFast(Long shopId, BaseSearchTimeVo timeVo);
    R findPage(Page page, FxShopMoneyFlowVo fxShopMoneyFlowVo);


	FxWithdrawal addWaiterWithdrawal(Long withdrawalType, Long companyId, Long brandId, Long shopId,
									 Long waiterId, BigDecimal money, BigDecimal balance, BigDecimal shopBalance, Integer status, String batchNumber);
	void addShopMoneyFlow(List<FxWithdrawal> list);
	BigDecimal rechargeMoney(Long id);

	R getShopPage(Page page, FxShopMoneyFlowVo vo);

    List<FxShopMoneyFlowVo> show(CnBrand data);

	FxShopMoneyFlowVo rechargeItem(CnBrand data, FxShopMoneyFlow fxShopMoneyFlow);

	/**
	 * 获取门店余额
	 * @param shopId
	 * @return
	 */
    FxShopMoneyFlowVo getShopBalance(Long shopId);

	List<FxShopMoneyFlowVo> showCnShop(CnShop cnShop);

	/**
	 * 充值 b端账户表
	 * @param fxShopMoneyFlow 门店资金流水
	 * @return R
	 */
	void addChargeMerchantAccount(FxShopMoneyFlow fxShopMoneyFlow);

	/**
	 * 分页查询 充值记录表
	 * @param page                   分页对象
	 * @param fxShopMoneyFlowVo      充值记录表
	 * @return
	 */
	IPage<FxShopMoneyFlowVo> getChargeRecordPage(Page page, FxShopMoneyFlowVo fxShopMoneyFlowVo);

	Page<MoneyFlowVo> chargeRecordPage(Page page, MoneyFlowVo moneyFlowVo);

	List<MoneyFlowVo> chargeRecordPage(MoneyFlowVo moneyFlowVo);
}
